class Feed < ActiveRecord::Base
  
  belongs_to :user  
  belongs_to :tool
  belongs_to :info  
  belongs_to :introducedor, :class_name => "User", :foreign_key => "introducedor_id"
  
  def self.all_abount_introduce(args = {:limit => 20})
    all :conditions => [
        'type = ? or type = ?',
        'Feed::MoneyIntroduceToBindFetion',
        'Feed::MoneyIntroduceToJoin'
      ],
      :order  => 'created_at desc',
      :limit => args[:limit]
  end
  
  def consume_in_taobao?
    is_a?(Feed::MoneyConsumedInTaobao)
  end
end
